<template>
  <div class="body">
    <!-- 标题 -->
    <v-head></v-head>
    <!-- 高级检索 -->
    <Row class="restand">
        <i-col class="standkepu" span="22">
          <div class="standardt">
            订单详情
          </div>
          <div class="detail">
            <div class="standtitle">{{ ordername }}</div>
            <div class="standnum"><span class="standnumbz">{{ memo }}</span><span class="standnumtj">{{ orderSn }}</span></div>
            <div class="standfenge1"></div>
            <div class="standmiaoshu">
                <Steps :current="1">
                    <Step title="下单" content="确认订单"></Step>
                    <Step title="已完成" content="发送标准"></Step>
                </Steps>
            </div>
            <div class="jichutitle" >订单信息</div>
            <div class="shijianzhou">
              标准号&#12288;&#12288;{{standardId}}
            </div>
            <div class="shijianzhou">
              购买日期&#12288;&#12288;{{buydate}}
              <!-- <span class="jichuitem">地址&#12288;&#12288;{{shipAddress}}</span> -->
            </div>
            <div class="shijianzhou">
              联系电话&#12288;&#12288;{{shipMobile}}
              <span class="jichuitem">用户名称&#12288;&#12288;{{shipName}}</span>
            </div>
            <div class="shijianzhou">
              邮箱&#12288;&#12288;{{shipEmail}}
              <span class="jichuitem">标准页数&#12288;&#12288;{{standardPages}}</span>
            </div>
            <div class="shijianzhou">
              订单金额&#12288;&#12288;{{productTotalPrice}}
            </div>
            <div class="jichutitle" >商品详情</div>
            <div class="orderiteml" v-for="(item,index) in childlist" :key="index">
              <div class="shijianzhou">
                标准名称&#12288;&#12288;{{item.productName}}
                <span class="jichuitem">标准号&#12288;&#12288;{{item.standardId}}</span>
              </div>
              <div class="shijianzhou">
                <!-- 购买者单位&#12288;&#12288;{{item.memberCompany}} -->
                <span >购买日期&#12288;&#12288;{{item.createDate}}</span>
                <span class="jichuitem">购买价格&#12288;&#12288;{{item.productPrice}}</span>
              </div>
            </div>
          </div>
        </i-col>
    </Row>
    <!-- 底部 -->
    <v-foot></v-foot>
    <Back-top></Back-top>
  </div>
</template>
<script>
import {neturl} from '../assets/js/common'
export default {
  name: 'seniorsearch',
  data () {
    return {
      msg: '内蒙古标准文献服务平台',
      theme1: 'light',
      byname: 'bymenu',
      modal1: false,
      userinfo: '',
      username: '',
      ordername: '订单名称',
      memo: '',
      orderSn: '',
      deliveryTypeName: '',
      shipAddress: '',
      shipMobile: '',
      shipName: '',
      shipEmail: '',
      standardId: '',
      standardPages: '',
      productTotalPrice: '',
      islogin: false,
      islog: true,
      // 标准状态
      orderStatus: '',
      // 订单商品详情
      childlist: [],
      buydate: ''
    }
  },
  methods: {
    logout () {
      this.$cookie.delete('user')
      let routeUrl = this.$router.resolve({
        path: '/'
      })
      window.open(routeUrl.href)
    }
  },
  created () {
    this.$Spin.show()
    // this.model1 = this.cityList[0].value
    this.userinfo = this.$cookie.get('user')
    if (this.userinfo === null) {
      this.$router.push('/login')
    }
    this.userinfo = JSON.parse(this.userinfo)
    // 已登录
    if (this.userinfo != null) {
      this.islogin = true
      this.islog = false
      this.username = this.userinfo.realName
    }
    // 获取订单详情
    let id = this.$route.query.id
    let upload = { data: id }
    this.$axios.post(neturl + '/by/order/getById?token=' + this.userinfo.token + '&loginMark=' + this.userinfo.loginMark, upload
    ).then(res => {
      this.$Spin.hide()
      // console.log(res)
      let orders = res.data.data.result
      this.ordername = JSON.stringify(orders.standardName).replace(new RegExp('>', 'g'), '').replace(new RegExp('<', 'g'), ' ').replace(new RegExp('<', 'g'), ' ').replace(new RegExp('b', 'g'), ' ').replace(new RegExp('r', 'g'), ' ').replace(new RegExp('"', 'g'), ' ')
      this.memo = orders.memo
      this.orderSn = orders.orderSn
      this.buydate = orders.createDate
      this.shipAddress = orders.shipAddress
      this.shipMobile = orders.shipMobile
      this.shipName = orders.shipName
      this.shipEmail = orders.shipEmail
      this.standardId = JSON.stringify(orders.standardId).replace(new RegExp('>', 'g'), '').replace(new RegExp('<', 'g'), ' ').replace(new RegExp('<', 'g'), ' ').replace(new RegExp('b', 'g'), ' ').replace(new RegExp('r', 'g'), ' ').replace(new RegExp('"', 'g'), ' ')
      this.standardPages = orders.standardPages
      this.productTotalPrice = orders.productTotalPrice
      // 商品详情
      this.childlist = orders.childList
    })
  }
}
</script>

<style scoped>
  @import '../assets/css/orderdetail.css';
</style>
